﻿<?php
Class indexController Extends baseController {
public function index(){
    $username= $_POST['username'];
    $pass= md5($_POST['password']);
    $db= New DB();
    $excute = $db->run("SELECT * FROM `users` WHERE `username`='$username' and `password`='$pass'");    
    if (!count($excute)==0){
        setcookie('user_id', $excute[0]['id'], time()+3600);
        setcookie('username', $excute[0]['name'], time()+3600); 
    };
    $this->registry->template->page_title = 'TRANG CHỦ';
    $this->registry->template->welcome = 'TRANG CHỦ';
    $this->registry->template->show('index');
}


}

?>
